﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;

namespace ComicsDownloader.TestConsole
{
    class Program
    {
        private const string Input = "<A title=\"4581화 아내의 지혜\" href=\"/cartoon/ctview.htm?sc2=ing&amp;sc3=1&amp;tpg=1&amp;id=2014092509024748604A\" rdsub=\"text01\" rdtopid=\"list\" rdsec3=\"1\" rdsec2=\"ing\" rdsec1=\"cartoon\"><SPAN>4581화 아내의 지혜</SPAN></A>";

        static void Main(string[] args)
        {
            Request(@"http://i1.cartoon.daumcdn.net/svc/image/U03/cartoon/535DA0BD020B7C0001", @"C:\Users\thkim\Desktop\2014-09-27\1.jpg");
//            Request(@"http://webtoon.daum.net/webtoon/view/sooldogirl", @"C:\Users\thkim\Desktop\2014-09-27\sooldogirl.html");
//            Request(@"http://webtoon.daum.net/webtoon/view/breakup#1", @"C:\Users\thkim\Desktop\2014-09-27\1.html");
//            Request(@"http://webtoon.daum.net/webtoon/view/breakup#2", @"C:\Users\thkim\Desktop\2014-09-27\2.html");

            return;
            var matches = Regex.Matches(Input, @"\d{19}A");
            foreach (Match match in matches)
            {
                Console.WriteLine(match.Value);
            }
        }

        private static void Request(string url, string filePath)
        {
            WebClient client = new WebClient();
            client.DownloadFile(url, filePath);
        }
    }
}
